export default {
  data () {
    return {
      // 图表实例
      myChart: {},
      // data
      numericalValue: {},
      // 最高最低温湿度的数据
      degreeData: {},
      // 信息集合
      resData: {},
      // 温度
      temperatureData: [],
      // 湿度
      humidityData: [],
      // x轴数据
      xAxisData: []
    }
  },
  created () {
    this.statisticsQuery()
  },
  methods: {
    async statisticsQuery () {
      if (!this.orderId) return
      let { data } = await this.order.temperatureHumidity({ orderId: this.orderId })
      this.numericalValue = data
      this.humidityData = data?.humidity
      this.temperatureData = data?.temperature
      this.xAxisData = data?.axisX
      this.degreeData = {
        maxHumidity: data?.maxHumidity, // 最高湿度
        maxTemperature: data?.maxTemperature, // 最高温度
        minHumidity: data?.minHumidity, // 最低湿度
        minTemperature: data?.minTemperature// 最低温度
      }
      this.resData = {
        tipList: this._getTipListText(this.degreeData),
        humidityData: this.humidityData,
        temperatureData: this.temperatureData,
        xAxisData: this.xAxisData,
        degreeData: this.degreeData
      }
      this._setEcharts(this.resData)
    }
  }
}